/*
 * ModuleList.java
 *
 * Created on October 17, 2007, 4:18 PM
 */

package jia.editor.lists;

import jia.editor.EditorMain;
import jia.editor.forms.LevelForm;
import jia.editor.widgets.LevelsTable;
import jia.tools.PanelSwapper;

/**
 *
 * @author  estell
 */
public class pnl_ModuleList extends javax.swing.JPanel {
    
    /** Creates new form ModuleList */
    public pnl_ModuleList() {
        initComponents();
        this.scrl_LevelList.setViewportView(new LevelsTable(this));
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        sp_MainPane = new javax.swing.JSplitPane();
        scrl_Text = new javax.swing.JScrollPane();
        txt_Details = new javax.swing.JTextPane();
        scrl_LevelList = new javax.swing.JScrollPane();
        btn_Add = new javax.swing.JButton();
        btn_Edit = new javax.swing.JButton();
        btn_Delete = new javax.swing.JButton();
        btn_Cancel = new javax.swing.JButton();

        setPreferredSize(new java.awt.Dimension(800, 580));
        sp_MainPane.setBorder(javax.swing.BorderFactory.createTitledBorder(null, java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("title_Modules"), javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.BELOW_TOP));
        sp_MainPane.setDividerLocation(400);
        sp_MainPane.setDividerSize(7);
        sp_MainPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        sp_MainPane.setLastDividerLocation(400);
        sp_MainPane.setOneTouchExpandable(true);
        txt_Details.setBackground(new java.awt.Color(0, 0, 0));
        txt_Details.setEditable(false);
        txt_Details.setForeground(new java.awt.Color(255, 255, 255));
        scrl_Text.setViewportView(txt_Details);

        sp_MainPane.setRightComponent(scrl_Text);

        sp_MainPane.setLeftComponent(scrl_LevelList);

        btn_Add.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/add.png")));
        btn_Add.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_Add.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add"));
        btn_Add.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_Add.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_Add.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_Add.setPreferredSize(new java.awt.Dimension(125, 30));
        btn_Add.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_AddActionPerformed(evt);
            }
        });

        btn_Add.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_Add.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add"));

        btn_Edit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/pencil.png")));
        btn_Edit.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_Edit.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit"));
        btn_Edit.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_Edit.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_Edit.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_Edit.setPreferredSize(new java.awt.Dimension(125, 30));
        btn_Edit.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_Edit.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit"));

        btn_Delete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/delete.png")));
        btn_Delete.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_Delete.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete"));
        btn_Delete.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_Delete.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_Delete.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_Delete.setPreferredSize(new java.awt.Dimension(125, 30));
        btn_Delete.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_Delete.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete"));

        btn_Cancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/door_out.png")));
        btn_Cancel.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_Cancel.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel"));
        btn_Cancel.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_Cancel.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_Cancel.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_Cancel.setPreferredSize(new java.awt.Dimension(125, 30));
        btn_Cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_CancelActionPerformed(evt);
            }
        });

        btn_Cancel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_Cancel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel"));

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(sp_MainPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 649, Short.MAX_VALUE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(btn_Add, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, btn_Edit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, btn_Delete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, btn_Cancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(sp_MainPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 558, Short.MAX_VALUE)
                    .add(layout.createSequentialGroup()
                        .add(btn_Add, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btn_Edit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btn_Delete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 426, Short.MAX_VALUE)
                        .add(btn_Cancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btn_AddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_AddActionPerformed
        PanelSwapper.swap(new LevelForm(), this); 
    }//GEN-LAST:event_btn_AddActionPerformed

    private void btn_CancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_CancelActionPerformed
        PanelSwapper.swap(EditorMain.p_defaultAdminPanel, this); 
    }//GEN-LAST:event_btn_CancelActionPerformed



    public void setConsoleText(String string) {
        this.txt_Details.setText(string);
    }
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_Add;
    private javax.swing.JButton btn_Cancel;
    private javax.swing.JButton btn_Delete;
    private javax.swing.JButton btn_Edit;
    private javax.swing.JScrollPane scrl_LevelList;
    private javax.swing.JScrollPane scrl_Text;
    private javax.swing.JSplitPane sp_MainPane;
    private javax.swing.JTextPane txt_Details;
    // End of variables declaration//GEN-END:variables
    
}
